package net.com.sunkey.messagehandler;

import java.nio.ByteBuffer;

import net.com.sunkey.protobuf.Protocol;
import net.com.sunkey.protobuf.RoomRemoveResponse.RoomRemoveResponseData;
import net.com.sunkey.serverlogic.Server;

/**
 * @author kohachiro
 *
 */
public class RoomRemoveResponseHandler {
	/* (non-Javadoc)
	 * @see com.sunkey.tdserver.messagehandler.MessageHandler#invoke(java.lang.Object, org.jboss.netty.channel.Channel)
	 */
	//@Override
	public static int invoke(Object data, Object channel) throws Exception {
		System.out.println("["+channel.hashCode()+"]["+Protocol.MessageHandler.RoomRemoveResponse_VALUE+"]RoomRemoveResponse");
		RoomRemoveResponseData.Builder builder=RoomRemoveResponseData.newBuilder();
		builder.setRoomid((int)data);
		RoomRemoveResponseData message=builder.build();

		Server.sendResponse(Protocol.MessageHandler.RoomRemoveResponse_VALUE, ByteBuffer.wrap(message.toByteArray()), channel);
		return Protocol.MessageHandler.RoomRemoveResponse_VALUE;
	}
}
